#ifndef _BUOLA_SCENE_CPRISMATICJOINT_H_
#define _BUOLA_SCENE_CPRISMATICJOINT_H_

#include <buola/scene/ctransform.h>
#include <buola/mat/transformations.h>

namespace buola { namespace scene {

class CPrismaticJoint : public CTransform
{
public:
    CPrismaticJoint(const mat::CVec3d &pTranslation=mat::CVec3d(0,0,0),const mat::CVec3d &pAxis=mat::CVec3d(1,0,0),
                     double pOffset=0.0,double pInitialValue=0.0,const std::string &pName=std::string());

    void SetTranslation(const mat::CVec3d &pTrans);
    void SetAxis(const mat::CVec3d &pAxis);
    void SetOffset(double pOffset);
    void SetValue(double pValue);

    const mat::CVec3d &Translation()    {   return mTranslation;    }
    const mat::CVec3d &Axis()           {   return mAxis;           }
    double Offset()                     {   return mOffset;         }
    double Value()                      {   return mValue;          }

    mat::CMat34d GetLocalTransformForValue(double pValue);
    mat::CMat34d GetWorldTransformForValue(double pValue);
    
private:
    virtual void CalcLocalTransform();

private:
    mat::CVec3d mTranslation;
    mat::CVec3d mAxis;
    double mOffset;
    double mValue;
};

PPrismaticJoint find_prismatic_joint(const PTransform &pWhere,const std::string &pName);

/*namespace scene*/ } /*namespace buola*/ }

#endif
